<?php
class Main extends GetData{

	public $daten;
	public $System;

	public function __construct($match){
		$this->daten = $match;
	}

	public function getWort(RainTPL $design){
	    $this->design = $design;
	    parent::GetData();
		
		//throw new Exception (CHANGE_CONTROLLER);
		if($this->design->url != '/'){
			HTTP::redirect(ConfigFile::Get("404"));
		}

		$crumb = new Crumb($design);
		$this->design->assign ('bcn', $crumb->getCrumb_Name());
		$this->design->assign ('bcrumb',$crumb->getCrumb());
		$this->design->assign ('css',"startseite");
		$this->design->assign ('js',"jsHome");

		$Visitor_Total = new Db_user_page_visitor();
		$Visitor_Total = $Visitor_Total->getVisitorsTotalByUserId($this->ActivUser->id);
	    
		$navi = new Db_user_page_static();
		$navi = $navi->getNavi("Neuigkeiten","NULL");		
		$this->design->assign ('navi',$navi);	
		
		$DBMail = new Db_Mail();
		$DBPublish = new Db_Publish();
		
		$this->design->assign ('MyPagesVisitorsTotal',$Visitor_Total);
		$this->design->assign ('UnReadedMails',$DBMail->GetCountUnReadedMails($_SESSION ['UserId']));
		$this->design->assign ('Publish',$DBPublish->GetLastPublish($this->ActivUser->id));
	 
		if( $cache = $this->design->cache( $this->design->ln.'/overview_m', $expire_time = 600 ) )
		 {
		 	echo $cache;
		 }
		 else
		 {
		 	$this->design->draw( $this->design->ln.'/overview_m' );
		 }
	}

}
?>